Skip to content

tui: keep cleared Fast tier from reappearing after side-thread resume#23121

Merged
etraut-openai merged 2 commits into
mainfrom
etraut/fix-fast-tier-cache
May 18, 2026
Merged

tui: keep cleared Fast tier from reappearing after side-thread resume#23121
etraut-openai merged 2 commits into
mainfrom
etraut/fix-fast-tier-cache

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai commented May 17, 2026

Why

After turning Fast mode off in the TUI, returning from a side thread could make Fast appear again in the main chat widget. The opt-out itself was still persisted; the display was being rebuilt from stale cached ThreadSessionState data, which made it look like Fast had been re-enabled.

Fixes #23104.

What changed

  • Keep the active thread's cached service_tier in sync whenever the user persists a service-tier selection.
  • Update both the primary-thread snapshot and the thread event store so restored TUI state reflects the current tier.
  • Add a focused regression test for clearing a cached Fast tier.

Manual repro

  1. Start a TUI session where Fast is enabled by default.
  2. Run /fast and turn Fast mode off. Confirm Fast disappears from the chat widget display.
  3. Re-enter thread navigation via either path:
    • Run /side test, then return to the main thread.
    • Run /agent, enter a child thread, then return to the main thread.
  4. Before this fix, Fast reappears in the main chat widget display even though the opt-out was already persisted.
  5. After this fix, Fast stays cleared.

Verification

  • cargo test -p codex-tui app::thread_session_state::tests::service_tier_sync_updates_active_cached_session -- --exact

@etraut-openai etraut-openai marked this pull request as ready for review May 17, 2026 07:21
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, approved

@etraut-openai etraut-openai merged commit fce10e0 into main May 18, 2026
31 checks passed
@etraut-openai etraut-openai deleted the etraut/fix-fast-tier-cache branch May 18, 2026 15:52
@github-actions github-actions Bot locked and limited conversation to collaborators May 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fast mode activates on its own

2 participants